package com.xbongbong.saas.script.tempenum;

import com.xbongbong.paas.pojo.FieldAttrEntityForDecisionInfo;
import com.xbongbong.saas.enums.business.ProjectDecisionInfoEnum;
import com.xbongbong.saas.enums.dictionary.DecisionInfoCharacterTraitsEnum;
import com.xbongbong.saas.enums.dictionary.DecisionInfoContactDegreeEnum;
import com.xbongbong.saas.enums.dictionary.DecisionInfoRelationshipEnum;
import com.xbongbong.saas.enums.dictionary.DecisionInfoRoleEnum;
import com.xbongbong.saas.enums.dictionary.DecisionInfoStanceEnum;
import com.xbongbong.saas.script.help.InitExplainsHelper;
import lombok.Getter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @Author: hongxiao
 * @date: 2021-11-16 21:58
 */
@Getter
public enum TempProjectDecisionInfoEnum {
    //刷脚本专用枚举
    ROLE(ProjectDecisionInfoEnum.ROLE),
    STANCE(ProjectDecisionInfoEnum.STANCE),
    CONTACT_DEGREE(ProjectDecisionInfoEnum.CONTACT_DEGREE),
    CUSTOMER_RELATIONSHIP(ProjectDecisionInfoEnum.CUSTOMER_RELATIONSHIP),
    CHARACTER_TRAITS(ProjectDecisionInfoEnum.CHARACTER_TRAITS),
    ;
    /**
     * 项目决策信息
     */
    private ProjectDecisionInfoEnum anEnum;

    TempProjectDecisionInfoEnum(ProjectDecisionInfoEnum anEnum) {
        this.anEnum = anEnum;
    }

    public static List<TempProjectDecisionInfoEnum> getAllEnum() {
        List<TempProjectDecisionInfoEnum> list = new ArrayList<>();
        Collections.addAll(list, values());
        return list;
    }

    public static void initRole(FieldAttrEntityForDecisionInfo fieldAttrEntity) {
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(DecisionInfoRoleEnum.class, fieldAttrEntity.getFieldType()));
    }

    public static void initStance(FieldAttrEntityForDecisionInfo fieldAttrEntity) {
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(DecisionInfoStanceEnum.class, fieldAttrEntity.getFieldType()));
    }

    public static void initContactDegree(FieldAttrEntityForDecisionInfo fieldAttrEntity) {
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(DecisionInfoContactDegreeEnum.class, fieldAttrEntity.getFieldType()));
    }

    public static void initCustomerRelationship(FieldAttrEntityForDecisionInfo fieldAttrEntity) {
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(DecisionInfoRelationshipEnum.class, fieldAttrEntity.getFieldType()));
    }

    public static void initCharacterTraits(FieldAttrEntityForDecisionInfo fieldAttrEntity) {
        fieldAttrEntity.setItems(InitExplainsHelper.setCombItemByEnum(DecisionInfoCharacterTraitsEnum.class, fieldAttrEntity.getFieldType()));
    }
}
